package com.oocl.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "orderss")
@GenericGenerator(name = "orders_uuid", strategy = "uuid")
public class Orders implements Serializable {
	@Id
	@Column(name = "id", length = 36)
	@GeneratedValue(generator = "orders_uuid")
	private String id;

	@Column(name = "oid", length = 36)
	private String oid;
	@JoinColumn(name = "fid", referencedColumnName = "fid")
	@ManyToOne
	private Foods food;
	@JoinColumn(name = "icnum", referencedColumnName = "icnum")
	@ManyToOne
	private Merchants merchant;
	@JoinColumn(name = "cid", referencedColumnName = "cid")
	@ManyToOne
	private Clients client;
	@JoinColumn(name = "did", referencedColumnName = "did")
	@OneToOne
	private DeliverInfo deliverInfo;
	@Column(name = "compstate", length = 1)
	private String compstate;//投诉填写状态，已投诉过：1 未投诉过：0
	@Column(name = "ostate", length = 1)//0:未接单 1:已接单 2：拒接 3：正在配送 4:已完成 5:取消订单
	private String ostate;
	@Column(name = "fcnt")
	private int fcnt;
	@Column(name = "osum")
	private double osum;
	@Column(name = "otime")
	@Temporal(TemporalType.TIMESTAMP)
	private Date otime;

	public Orders() {
		super();
	}

	public Orders(String id, String oid, Foods food, Merchants merchant,
			Clients client, DeliverInfo deliverInfo, String compstate,
			String ostate, int fcnt, double osum, Date otime) {
		super();
		this.id = id;
		this.oid = oid;
		this.food = food;
		this.merchant = merchant;
		this.client = client;
		this.deliverInfo = deliverInfo;
		this.compstate = compstate;
		this.ostate = ostate;
		this.fcnt = fcnt;
		this.osum = osum;
		this.otime = otime;
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getOid() {
		return oid;
	}

	public void setOid(String oid) {
		this.oid = oid;
	}

	public Foods getFood() {
		return food;
	}

	public void setFood(Foods food) {
		this.food = food;
	}

	public Merchants getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchants merchant) {
		this.merchant = merchant;
	}

	public Clients getClient() {
		return client;
	}

	public void setClient(Clients client) {
		this.client = client;
	}

	public DeliverInfo getDeliverInfo() {
		return deliverInfo;
	}

	public void setDeliverInfo(DeliverInfo deliverInfo) {
		this.deliverInfo = deliverInfo;
	}

	public String getCompstate() {
		return compstate;
	}

	public void setCompstate(String compstate) {
		this.compstate = compstate;
	}

	public String getOstate() {
		return ostate;
	}

	public void setOstate(String ostate) {
		this.ostate = ostate;
	}

	public int getFcnt() {
		return fcnt;
	}

	public void setFcnt(int fcnt) {
		this.fcnt = fcnt;
	}

	public double getOsum() {
		return osum;
	}

	public void setOsum(double osum) {
		this.osum = osum;
	}

	public Date getOtime() {
		return otime;
	}

	public void setOtime(Date otime) {
		this.otime = otime;
	}

	
	

	
	
}
